#pragma once
#ifndef USERINTERFACE_H
#define USERINTERFACE_H

//directinput
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

//string 
#include <string>
using namespace std;

//vector
#include <vector>

#define NUMBER_OF_INPUTS 44
class CInput;

class CUserInterface
{
private:
	//singleton variable
	static CUserInterface* instance;

	//direct input objects
	LPDIRECTINPUT8 m_diObject;
	
	//index in the vector
	int m_indexInputKeyboard;
	int m_indexInputMouse;
	int m_indexInputXBoxController;

	//vector
	vector<CInput*> m_inputDevicesVector;

	//variable to convert the string from the xml into directx input
	int m_tableIntToDIK[NUMBER_OF_INPUTS];
	string m_tableStringToInt[NUMBER_OF_INPUTS];

	//menu variable
	int m_indexTextureMenu;

private:
	CUserInterface(void);
	~CUserInterface(void);

public:
	//singleton function
	static CUserInterface* getInstance(void);
	void close();

	//input functions
	bool initialiseInputs(HINSTANCE);
	void initialiseMenu(int indexTexture);
	bool loadActionMapping(string address);
	void doUpdateInputs();
	int getDirectInputValue(string input);

	//hud functions
	void displayHUD();
	void displayGameOver();
	void displayMenu();
};
#define UI CUserInterface::getInstance()

#endif
